<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
 <meta>
  <!-- Stylesheets -->
  <link href="../web.css" type="text/css" rel="stylesheet"></link>
  <link href="../pygmentize.css" type="text/css" rel="stylesheet"></link>
  <title>VLFeat - Documentation - C API</title>
  <link rel="stylesheet" type="text/css" href="../doxygen.css"></style>

  <!-- Scripts-->
  
 </meta>

 <!-- Body Start -->
 <body>
  <div id="header">
   <!-- Google CSE Search Box Begins -->
   <form action="http://www.vlfeat.org/search.html" method="get" id="cse-search-box" enctype="application/x-www-form-urlencoded">
    <div>
     <input type="hidden" name="cx" value="003215582122030917471:oq23albfeam"></input>
     <input type="hidden" name="cof" value="FORID:11"></input>
     <input type="hidden" name="ie" value="UTF-8"></input>
     <input type="text" name="q" size="31"></input>
     <input type="submit" name="sa" value="Search"></input>
    </div>
   </form>
   <script src="http://www.google.com/coop/cse/brand?form=cse-search-box&amp;lang=en" xml:space="preserve" type="text/javascript"></script>
   <!-- Google CSE Search Box Ends -->
   <h1><a shape="rect" href="../index.html" class="plain"><span id="vlfeat">VLFeat</span><span id="dotorg">.org</span></a></h1>
  </div>
  <div id="headbanner">
   Documentation - C API
  </div>
  <div id="pagebody">
   <div id="sidebar"> <!-- Navigation Start -->
    <ul>
<li><a href="../index.html">Home</a>
</li>
<li><a href="../download.html">Download</a>
</li>
<li><a href="../doc.html">Documentation</a>
<ul>
<li><a href="../mdoc/mdoc.html">Matlab API</a>
</li>
<li><a href="index.html" class='active' >C API</a>
</li>
<li><a href="../man/man.html">Man pages</a>
</li>
</ul></li>
<li><a href="../overview/tut.html">Tutorials</a>
</li>
<li><a href="../applications/apps.html">Applications</a>
</li>
</ul>

   </div> <!-- sidebar -->
   <div id="content">
    
    <link rel="stylesheet" type="text/css" href="../doxygen.css"></style>
    <div class="doxygen">
<div>
<!-- Generated by Doxygen 1.7.5.1 -->
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
      <li><a href="annotated.html"><span>Data&#160;Structures</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>File&#160;List</span></a></li>
      <li><a href="globals.html"><span>Globals</span></a></li>
    </ul>
  </div>
</div>
<div class="header">
  <div class="summary">
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">quickshift.c File Reference</div>  </div>
</div>
<div class="contents">

<p>Quick shift - Definition.  
<a href="#details">More...</a></p>
<div class="textblock"><code>#include &quot;<a class="el" href="quickshift_8h.html">quickshift.h</a>&quot;</code><br/>
<code>#include &quot;<a class="el" href="mathop_8h.html">mathop.h</a>&quot;</code><br/>
<code>#include &lt;string.h&gt;</code><br/>
<code>#include &lt;math.h&gt;</code><br/>
<code>#include &lt;stdio.h&gt;</code><br/>
</div><table class="memberdecls">
<tr><td colspan="2"><h2><a name="func-members"></a>
Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="quickshift_8h.html#aee7aaa0947ccf164d8072bd798f419e2">vl_qs_type</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="quickshift_8c.html#aa70ffb9d0d0c62908a46b425604a7065">vl_quickshift_distance</a> (<a class="el" href="quickshift_8h.html#aee7aaa0947ccf164d8072bd798f419e2">vl_qs_type</a> const *I, int N1, int N2, int K, int i1, int i2, int j1, int j2)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Computes the accumulated channel L2 distance between i,j + the distance between i,j.  <a href="#aa70ffb9d0d0c62908a46b425604a7065"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="quickshift_8h.html#aee7aaa0947ccf164d8072bd798f419e2">vl_qs_type</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="quickshift_8c.html#a7d317b966c114ce48d921fbeeef13a3c">vl_quickshift_inner</a> (<a class="el" href="quickshift_8h.html#aee7aaa0947ccf164d8072bd798f419e2">vl_qs_type</a> const *I, int N1, int N2, int K, int i1, int i2, int j1, int j2)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Computes the accumulated channel inner product between i,j + the distance between i,j.  <a href="#a7d317b966c114ce48d921fbeeef13a3c"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="structVlQS.html">VlQS</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="quickshift_8c.html#a9fc34955bf121df6d1d5bd991b8d2b13">vl_quickshift_new</a> (<a class="el" href="quickshift_8h.html#aee7aaa0947ccf164d8072bd798f419e2">vl_qs_type</a> const *image, int height, int width, int channels)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Create a quick shift object.  <a href="#a9fc34955bf121df6d1d5bd991b8d2b13"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="quickshift_8c.html#aebfc7337283b7a8f8be1a1c0fd4f5f92">vl_quickshift_process</a> (<a class="el" href="structVlQS.html">VlQS</a> *q)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Create a quick shift objet.  <a href="#aebfc7337283b7a8f8be1a1c0fd4f5f92"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="quickshift_8c.html#a9c2a39344fb684d899f22faf358425e8">vl_quickshift_delete</a> (<a class="el" href="structVlQS.html">VlQS</a> *q)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Delete quick shift object.  <a href="#a9c2a39344fb684d899f22faf358425e8"></a><br/></td></tr>
</table>
<hr/><a name="details" id="details"></a><h2>Detailed Description</h2>
<div class="textblock"><dl class="author"><dt><b>Author:</b></dt><dd>Brian Fulkerson </dd>
<dd>
Andrea Vedaldi </dd></dl>
</div><hr/><h2>Function Documentation</h2>
<a class="anchor" id="a9c2a39344fb684d899f22faf358425e8"></a><!-- doxytag: member="quickshift.c::vl_quickshift_delete" ref="a9c2a39344fb684d899f22faf358425e8" args="(VlQS *q)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void vl_quickshift_delete </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structVlQS.html">VlQS</a> *&#160;</td>
          <td class="paramname"><em>q</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">q</td><td>quick shift object. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="aa70ffb9d0d0c62908a46b425604a7065"></a><!-- doxytag: member="quickshift.c::vl_quickshift_distance" ref="aa70ffb9d0d0c62908a46b425604a7065" args="(vl_qs_type const *I, int N1, int N2, int K, int i1, int i2, int j1, int j2)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="quickshift_8h.html#aee7aaa0947ccf164d8072bd798f419e2">vl_qs_type</a> vl_quickshift_distance </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="quickshift_8h.html#aee7aaa0947ccf164d8072bd798f419e2">vl_qs_type</a> const *&#160;</td>
          <td class="paramname"><em>I</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>N1</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>N2</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>K</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>i1</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>i2</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>j1</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>j2</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td><code> [inline]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">I</td><td>input image buffer </td></tr>
    <tr><td class="paramname">N1</td><td>size of the first dimension of the image </td></tr>
    <tr><td class="paramname">N2</td><td>size of the second dimension of the image </td></tr>
    <tr><td class="paramname">K</td><td>number of channels </td></tr>
    <tr><td class="paramname">i1</td><td>first dimension index of the first pixel to compare </td></tr>
    <tr><td class="paramname">i2</td><td>second dimension of the first pixel </td></tr>
    <tr><td class="paramname">j1</td><td>index of the second pixel to compare </td></tr>
    <tr><td class="paramname">j2</td><td>second dimension of the second pixel</td></tr>
  </table>
  </dd>
</dl>
<p>Takes the L2 distance between the values in I at pixel i and j, accumulating along K channels and adding in the distance between i,j in the image.</p>
<dl class="return"><dt><b>Returns:</b></dt><dd>the distance as described above </dd></dl>

</div>
</div>
<a class="anchor" id="a7d317b966c114ce48d921fbeeef13a3c"></a><!-- doxytag: member="quickshift.c::vl_quickshift_inner" ref="a7d317b966c114ce48d921fbeeef13a3c" args="(vl_qs_type const *I, int N1, int N2, int K, int i1, int i2, int j1, int j2)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="quickshift_8h.html#aee7aaa0947ccf164d8072bd798f419e2">vl_qs_type</a> vl_quickshift_inner </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="quickshift_8h.html#aee7aaa0947ccf164d8072bd798f419e2">vl_qs_type</a> const *&#160;</td>
          <td class="paramname"><em>I</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>N1</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>N2</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>K</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>i1</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>i2</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>j1</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>j2</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td><code> [inline]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">I</td><td>input image buffer </td></tr>
    <tr><td class="paramname">N1</td><td>size of the first dimension of the image </td></tr>
    <tr><td class="paramname">N2</td><td>size of the second dimension of the image </td></tr>
    <tr><td class="paramname">K</td><td>number of channels </td></tr>
    <tr><td class="paramname">i1</td><td>first dimension index of the first pixel to compare </td></tr>
    <tr><td class="paramname">i2</td><td>second dimension of the first pixel </td></tr>
    <tr><td class="paramname">j1</td><td>index of the second pixel to compare </td></tr>
    <tr><td class="paramname">j2</td><td>second dimension of the second pixel</td></tr>
  </table>
  </dd>
</dl>
<p>Takes the channel-wise inner product between the values in I at pixel i and j, accumulating along K channels and adding in the inner product between i,j in the image.</p>
<dl class="return"><dt><b>Returns:</b></dt><dd>the inner product as described above </dd></dl>

</div>
</div>
<a class="anchor" id="a9fc34955bf121df6d1d5bd991b8d2b13"></a><!-- doxytag: member="quickshift.c::vl_quickshift_new" ref="a9fc34955bf121df6d1d5bd991b8d2b13" args="(vl_qs_type const *image, int height, int width, int channels)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="structVlQS.html">VlQS</a>* vl_quickshift_new </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="quickshift_8h.html#aee7aaa0947ccf164d8072bd798f419e2">vl_qs_type</a> const *&#160;</td>
          <td class="paramname"><em>image</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>height</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>width</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>channels</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">image</td><td></td></tr>
    <tr><td class="paramname">height</td><td></td></tr>
    <tr><td class="paramname">width</td><td></td></tr>
    <tr><td class="paramname">channels</td><td></td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>New quick shift object. </dd></dl>

</div>
</div>
<a class="anchor" id="aebfc7337283b7a8f8be1a1c0fd4f5f92"></a><!-- doxytag: member="quickshift.c::vl_quickshift_process" ref="aebfc7337283b7a8f8be1a1c0fd4f5f92" args="(VlQS *q)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void vl_quickshift_process </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structVlQS.html">VlQS</a> *&#160;</td>
          <td class="paramname"><em>q</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">q</td><td>quick shift object. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
</div>
     <!-- Doc Here -->
    </div>
   
   </div>
   <div class="clear">&nbsp;</div>
  </div> <!-- pagebody -->
  <div id="footer">
   &copy; 2007-12 Andrea Vedaldi and Brian Fulkerson
  </div> <!-- footer -->

  <!-- Google Analytics Begins -->
  <script xml:space="preserve" type="text/javascript">
   //<![CDATA[
    var localre = /vlfeat.org/;
    if(document.location.host.search(localre) != -1)
    {
   var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
   document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
   }
   //]]>
  </script>
  <script xml:space="preserve" type="text/javascript">
    //<![CDATA[
    var localre = /vlfeat.org/;
    if(document.location.host.search(localre) != -1)
    {

   try {
   var pageTracker = _gat._getTracker("UA-4936091-2");
   pageTracker._trackPageview();
   } catch(err) {}

   }
   //]]>
  </script>
  <!-- Google Analytics Ends -->
 </body>
</html>

 
